home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / libelf / elf_getident.z / elf_getident
Encoding:
Text File  |  1998-10-30  |  6.4 KB  |  169 lines

  1.  
  2.  
  3.  
  4. EEEELLLLFFFF____GGGGEEEETTTTIIIIDDDDEEEENNNNTTTT((((3333EEEE))))                                              EEEELLLLFFFF____GGGGEEEETTTTIIIIDDDDEEEENNNNTTTT((((3333EEEE))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _eeee_llll_ffff______gggg_eeee_tttt_iiii_dddd_eeee_nnnn_tttt - retrieve file identification data
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _cccc_cccc [_f_l_a_g ...] _f_i_l_e ...  _----_llll_eeee_llll_ffff [_l_i_b_r_a_r_y ...]
  13.  
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_eeee_llll_ffff_...._hhhh_>>>>
  15.      _cccc_hhhh_aaaa_rrrr _****_eeee_llll_ffff______gggg_eeee_tttt_iiii_dddd_eeee_nnnn_tttt_((((_EEEE_llll_ffff _****_eeee_llll_ffff_,,,, _ssss_iiii_zzzz_eeee______tttt _****_pppp_tttt_rrrr_))))_;;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      As _eeee_llll_ffff(3E) explains, ELF provides a framework for various classes of
  19.      files, where basic objects may have 32 bits, 64 bits, etc.  To
  20.      accommodate these differences, without forcing the larger sizes on
  21.      smaller machines, the initial bytes in an ELF file hold identification
  22.      information common to all file classes.  Every ELF header's _eeee______iiii_dddd_eeee_nnnn_tttt has
  23.      _EEEE_IIII______NNNN_IIII_DDDD_EEEE_NNNN_TTTT bytes with the following interpretation.
  24.  
  25.                 _eeee______iiii_dddd_eeee_nnnn_tttt Index      Value             Purpose
  26.                 __________________________________________________
  27.                 _EEEE_IIII______MMMM_AAAA_GGGG_0000         _EEEE_LLLL_FFFF_MMMM_AAAA_GGGG_0000
  28.                 _EEEE_IIII______MMMM_AAAA_GGGG_1111         _EEEE_LLLL_FFFF_MMMM_AAAA_GGGG_1111
  29.                 _EEEE_IIII______MMMM_AAAA_GGGG_2222         _EEEE_LLLL_FFFF_MMMM_AAAA_GGGG_2222
  30.                 _EEEE_IIII______MMMM_AAAA_GGGG_3333         _EEEE_LLLL_FFFF_MMMM_AAAA_GGGG_3333        File identification
  31.  
  32.                 __________________________________________________
  33.                                 _EEEE_LLLL_FFFF_CCCC_LLLL_AAAA_SSSS_SSSS_NNNN_OOOO_NNNN_EEEE
  34.                                 _EEEE_LLLL_FFFF_CCCC_LLLL_AAAA_SSSS_SSSS_3333_2222
  35.                 _EEEE_IIII______CCCC_LLLL_AAAA_SSSS_SSSS        _EEEE_LLLL_FFFF_CCCC_LLLL_AAAA_SSSS_SSSS_6666_4444     File class
  36.  
  37.                 __________________________________________________
  38.                                 _EEEE_LLLL_FFFF_DDDD_AAAA_TTTT_AAAA_NNNN_OOOO_NNNN_EEEE
  39.                                 _EEEE_LLLL_FFFF_DDDD_AAAA_TTTT_AAAA_2222_LLLL_SSSS_BBBB
  40.                 _EEEE_IIII______DDDD_AAAA_TTTT_AAAA         _EEEE_LLLL_FFFF_DDDD_AAAA_TTTT_AAAA_2222_MMMM_SSSS_BBBB    Data encoding
  41.  
  42.                 __________________________________________________
  43.                 _EEEE_IIII______VVVV_EEEE_RRRR_SSSS_IIII_OOOO_NNNN      _EEEE_VVVV______CCCC_UUUU_RRRR_RRRR_EEEE_NNNN_TTTT     File version
  44.                 __________________________________________________
  45.                 _7777_----_1111_5555            _0000              Unused, set to zero
  46.                 __________________________________________________
  47.                               |||||||||||||||||||
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                                              |||||||||||||||||||
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.      Other kinds of files [see _eeee_llll_ffff______kkkk_iiii_nnnn_dddd(3E)] also may have identification
  84.      data, though they would not conform to _eeee______iiii_dddd_eeee_nnnn_tttt.
  85.  
  86.      _eeee_llll_ffff______gggg_eeee_tttt_iiii_dddd_eeee_nnnn_tttt returns a pointer to the file's ``initial bytes.''  If the
  87.      library recognizes the file, a conversion from the file image to the
  88.      memory image may occur.  In any case, the identification bytes are
  89.      guaranteed not to have been modified, though the size of the unmodified
  90.      area depends on the file type.  If _p_t_r is non-null, the library stores
  91.      the number of identification bytes in the location to which _p_t_r points.
  92.      If no data are present, _e_l_f is null, or an error occurs, the return value
  93.      is a null pointer, with zero optionally stored through _p_t_r.
  94.  
  95.  
  96.  
  97.  
  98.  
  99.                                                                         PPPPaaaaggggeeee 1111
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106. EEEELLLLFFFF____GGGGEEEETTTTIIIIDDDDEEEENNNNTTTT((((3333EEEE))))                                              EEEELLLLFFFF____GGGGEEEETTTTIIIIDDDDEEEENNNNTTTT((((3333EEEE))))
  107.  
  108.  
  109.  
  110. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  111.      _eeee_llll_ffff(3E), _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn(3E), _eeee_llll_ffff______gggg_eeee_tttt_eeee_hhhh_dddd_rrrr(3E), _eeee_llll_ffff______kkkk_iiii_nnnn_dddd(3E), _eeee_llll_ffff______rrrr_aaaa_wwww_ffff_iiii_llll_eeee(3E).
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.                                                                         PPPPaaaaggggeeee 2222
  166.  
  167.  
  168.  
  169.